package com.white.androidstudy.annotation;

import android.app.Activity;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

/**
 * Created by yutf on 2017/9/7 0007.
 */

public class AnHandler
{
    public static void inject(Activity activity)
    {
        Class a = activity.getClass();
        if (a.isAnnotationPresent(LoginIntercept.class))
        {
            // 得到activity这个类的LoginIntercept注解
            LoginIntercept it = (LoginIntercept) a.getAnnotation(LoginIntercept.class);
            // 得到注解的值
            boolean userIntercept = it.value();
            boolean showUserInfo = it.showUserInfo();
            // 使用反射调用setLoginIntercept

        }
    }
}
